package homework01;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;

public class FinallyDemo2 {
    public static void main(String[] args) {
        FileOutputStream fos=null;
        try {
            fos=new FileOutputStream("/a.txt");
            fos.write(2);
        }catch (Exception e){
            System.out.println("解决异常");
        }finally {
            try {
                fos.close();
            }catch (Exception e){
                System.out.println("解决异常");
            }
        }
    }
}
